import request from '@/config/axios'
import type {
  placestartType,
  outercityType,
  purchaseType,
  storageType,
  transportType,
  customerManagementType,
  hvType,
  customsClearanceCompanyType,
  departmentType,
  sendType,
  CustomsClearanceFormType,
  user_brokerageType,
  userType,
  userGroupType
} from './types'
// 获取所有字典
export const getDictApi = (): Promise<IResponse> => {
  return request.get({ url: '/dict/list' })
}
// 模拟获取某个字典
export const getDictOneApi = async (): Promise<IResponse> => {
  return request.get({ url: '/dict/one' })
}

// 获取货物种类 - 下拉选择
export const goodsSelect = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/goods/selectpage', params })
}

// 获取运输方式 - 下拉选择
export const transportSelect = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/transport/selectpage', params })
}

// 始发地 - 下拉选择
export const placestartSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/placestart/selectpage' })
}

// 部门管理 - 下拉选择
export const departmentSelect = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/dept/selectpage', params })
}
// 员工管理 - 下拉选择
export const empSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/emp/selectpage' })
}
// 付款类型 - 下拉选择
export const getPayTypeList = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/purchase/getPayTypeList', params })
}

// 审核转改 - 下拉选择
export const getStatusList = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/purchase/getStatusList', params })
}

// 关联客户 - 下拉选择
export const clientSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/client/selectpage' })
}

// 货物位置 - 下拉选择
export const storeSelect = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/store/selectpage', params })
}
// 目的地 - 下拉选择
export const placeendSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/placeend/selectpage' })
}
// 分货市场 - 下拉选择
export const submarketSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/submarket/selectpage' })
}

// 包装方式 - 下拉选择
export const packSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/pack/selectpage' })
}

// 收件人 - 下拉选择
export const consigneeSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/consignee/selectpage' })
}
// 清关公司 - 下拉选择
export const customsSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/customs/selectpage' })
}

// 打包员 - 下拉选择
export const packerSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/packer/selectpage' })
}
/**
 * 始发地
 */
//查看
export const placestartIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/placestart/index', params })
}
//新增
export const placestartAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/placestart/add', data })
}
//修改
export const placestartEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/placestart/edit/ids/' + ids, data })
}
//删除
export const placestartDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/placestart/del', data: { ids } })
}
/**
 * 目的地
 */
//查看
export const placeendIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/placeend/index', params })
}
//新增
export const placeendAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/placeend/add', data })
}
//修改
export const placeendEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/placeend/edit/ids/' + ids, data })
}
//删除
export const placeendDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/placeend/del', data: { ids } })
}
/**
 * 收货人
 */
//查看
export const consigneeIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/consignee/index', params })
}
//新增
export const consigneeAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/consignee/add', data })
}
//修改
export const consigneeEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/consignee/edit/ids/' + ids, data })
}
//删除
export const consigneeDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/consignee/del', data: { ids } })
}
/**
 * 用户管理
 */
//查看
export const userIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/user/index', params })
}
//修改
export const userEdit = (data: userType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/user/edit/ids/' + ids, data })
}
//详情
export const userDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/user/edit/ids/' + ids })
}
//详情
export const userAdd = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/user/edit/ids/' + ids })
}

/**
 * 外传城市
 */
//查看
export const outercityIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/outercity/index', params })
}
//新增
export const outercityAdd = (data: outercityType): Promise<IResponse> => {
  return request.post({ url: '/api/outercity/add', data })
}
//修改
export const outercityEdit = (data: outercityType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/outercity/edit/ids/' + ids, data })
}
//删除
export const outercityDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/outercity/del', data: { ids } })
}
/**
 * 外办员工
 */
//查看
export const emp_foreignIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/emp_foreign/index', params })
}
//新增
export const emp_foreignAdd = (data: outercityType): Promise<IResponse> => {
  return request.post({ url: '/api/emp_foreign/add', data })
}
//修改
export const emp_foreignEdit = (data: outercityType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/emp_foreign/edit/ids/' + ids, data })
}
//删除
export const emp_foreignDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/emp_foreign/del', data: { ids } })
}
//
export const emp_foreignSelect = (): Promise<IResponse> => {
  return request.post({ url: '/api/emp_foreign/selectpage' })
}
/**
 * 返佣用户
 */
//查看
export const user_brokerageIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/user_brokerage/index', params })
}
//新增
export const user_brokerageAdd = (data: user_brokerageType): Promise<IResponse> => {
  return request.post({ url: '/api/user_brokerage/add', data })
}
//修改
export const user_brokerageEdit = (data: user_brokerageType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/user_brokerage/edit/ids/' + ids, data })
}
//删除
export const user_brokerageDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/user_brokerage/del', data: { ids } })
}
//详情
export const user_brokerageDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/user_brokerage/edit/ids/' + ids })
}
//下拉
export const user_brokerageSelectpage = (): Promise<IResponse> => {
  return request.get({ url: '/api/user_brokerage/selectpage' })
}
/**
 * 分获市场
 */
//查看
export const submarketIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/submarket/index', params })
}
//新增
export const submarketAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/submarket/add', data })
}
//修改
export const submarketEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/submarket/edit/ids/' + ids, data })
}
//删除
export const submarketDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/submarket/del', data: { ids } })
}

/**
 * 运输方式
 */
//查看
export const transportIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/transport/index', params })
}
//新增
export const transportAdd = (data: transportType): Promise<IResponse> => {
  return request.post({ url: '/api/transport/add', data })
}
//修改
export const transportEdit = (ids: string, data: transportType): Promise<IResponse> => {
  return request.post({ url: '/api/transport/edit/ids/' + ids, data })
}
//删除
export const transportDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/transport/del', data: { ids } })
}
//详情
export const transportDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/transport/edit/ids/' + ids })
}
//下拉选择
export const transportSelectpage = (): Promise<IResponse> => {
  return request.get({ url: '/api/transport/selectpage' })
}
/**
 * 包装方式
 */
//查看
export const packIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/pack/index', params })
}
//新增
export const packAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/pack/add', data })
}
//修改
export const packEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/pack/edit/ids/' + ids, data })
}
//删除
export const packDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/pack/del', data: { ids } })
}
/**
 * 货品管理
 */
//查看
export const goodsIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/goods/index', params })
}
//新增
export const goodsAdd = (data: placestartType): Promise<IResponse> => {
  return request.post({ url: '/api/goods/add', data })
}
//修改
export const goodsEdit = (data: placestartType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/goods/edit/ids/' + ids, data })
}
//删除
export const goodsDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/goods/del', data: { ids } })
}
//下拉
export const goodsSel = (): Promise<IResponse> => {
  return request.post({ url: '/api/goods/selectpage' })
}
/**
 * 汇率设置
 */
//查看
export const deliverIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/conversion/index', params })
}
//新增
export const deliverAdd = (data: hvType): Promise<IResponse> => {
  return request.post({ url: '/api/conversion/add', data })
}
//修改
export const deliverEdit = (data: hvType, ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/conversion/edit/ids/' + ids, data })
}
//删除
export const deliverDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/conversion/del', data: { ids } })
}

/**
 * 仓库货物
 */
//查看
export const repertoryIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/repertory/index', params })
}
//修改
export const repertoryEdit = (data: storageType, ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/repertory/edit/ids/' + ids, data })
}
//详情
export const repertoryDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/repertory/edit/ids/' + ids })
}
//查看
export const getClientRepertoryList = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/repertory/getClientRepertoryList', params })
}

/**
 * 采购单
 */
//查看
export const purchaseIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/purchase/index', params })
}
//新增
export const purchaseAdd = (data: purchaseType): Promise<IResponse> => {
  return request.post({ url: '/api/purchase/add', data })
}
//修改
export const purchaseEdit = (ids: string, data: purchaseType): Promise<IResponse> => {
  return request.post({ url: '/api/purchase/edit/ids/' + ids, data })
}
//删除
export const purchaseDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/purchase/del', data: { ids } })
}
//详情
export const purchaseDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/purchase/edit/ids/' + ids })
}
//提交审核
export const purchaseSubmit = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/purchase/submit', data: { ids } })
}

export const purchasePassed = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/purchase/audit', data: { ids, status: 2 } })
}

//转销售单
export const purchaseSaleAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/sale/add', data })
}
/**
 * 入库单
 */
//查看
export const storageIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/storage/index', params })
}
//新增
export const storageAdd = (data: storageType): Promise<IResponse> => {
  return request.post({ url: '/api/storage/add', data })
}
//修改
export const storageEdit = (ids: string, data: storageType): Promise<IResponse> => {
  return request.post({ url: '/api/storage/edit/ids/' + ids, data })
}
//删除
export const storageDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/storage/del', data: { ids } })
}
//详情
export const storageDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/storage/edit/ids/' + ids })
}
//一件入库
export const enterRk = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/storage/repertory', data })
}

//生成退货单
export const getRepertoryList = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/storage/getRepertoryList', params })
}

//批量入库单转出库单
export const multiCreateDeliver = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/storage/multiCreateDeliver', data })
}
//导出入库单
export const rkdExportExcel = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/storage/exportExcel', responseType: 'blob', data })
}

/**
 * 提交审核
 * @param ids
 * @returns
 */
export const storageSubmit = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/storage/submit', data: { ids } })
}

/**
 * 审核
 * @param ids
 * @returns
 */
export const storageAudit = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/storage/audit', data: { ids, status: '2' } })
}

/**
 * 部门管理
 */
//查看
export const deptIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/dept/index', params })
}
//新增
export const deptAdd = (data: departmentType): Promise<IResponse> => {
  return request.post({ url: '/api/dept/add', data })
}
//删除
export const deptDEL = (ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/dept/del', data: { ids } })
}
//修改
export const deptEdit = (data: departmentType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/dept/edit/ids/' + ids, data })
}
//详情
export const deptDetail = (ids: string): Promise<IResponse> => {
  return request.get({ url: '/api/dept/edit/ids/' + ids })
}
/**
 * 员工管理
 */
//查看
export const empIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/emp/index', params })
}
//新增
export const empAdd = (data: departmentType): Promise<IResponse> => {
  return request.post({ url: '/api/emp/add', data })
}
//删除
export const empDEL = (ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/emp/del', data: { ids } })
}
//修改
export const empEdit = (data: departmentType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/emp/edit/ids/' + ids, data })
}
//详情
export const empDetail = (ids: string): Promise<IResponse> => {
  return request.get({ url: '/api/emp/edit/ids/' + ids })
}
/**
 * 打包员
 */
//查看
export const packerIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/packer/index', params })
}
//新增
export const packerAdd = (data: departmentType): Promise<IResponse> => {
  return request.post({ url: '/api/packer/add', data })
}
//删除
export const packerDEL = (ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/packer/del', data: { ids } })
}
//修改
export const packerEdit = (data: departmentType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/packer/edit/ids/' + ids, data })
}
//详情
export const packerDetail = (ids: string): Promise<IResponse> => {
  return request.get({ url: '/api/packer/edit/ids/' + ids })
}
/**
 * 客户管理
 */
//查看
export const clientIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/client/index', params })
}
//新增
export const clientAdd = (data: customerManagementType): Promise<IResponse> => {
  return request.post({ url: '/api/client/add', data })
}
//删除
export const clientDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/client/del', data: { ids } })
}
//修改
export const clientEdit = (data: customerManagementType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/client/edit/ids/' + ids, data })
}
//详情
export const clientDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/client/edit/ids/' + ids })
}
/**
 * 清关公司
 */
//查看
export const customsIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/customs/index', params })
}
//新增
export const customsAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/customs/add', data })
}
//修改
export const customsEdit = (ids: string, data: customsClearanceCompanyType): Promise<IResponse> => {
  return request.post({ url: '/api/customs/edit/ids/' + ids, data })
}
//删除
export const customsDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/customs/del', data: { ids } })
}
//详情
export const customsDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/customs/edit/ids/' + ids })
}

/**
 * 仓库管理
 * */
//查看
export const storeIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/store/index', params })
}
//新增
export const storeAdd = (data: storageType): Promise<IResponse> => {
  return request.post({ url: '/api/store/add', data })
}
//修改
export const storeEdit = (data: storageType, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/store/edit/ids/' + ids, data })
}
//删除
export const storeDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/store/del', data: { ids } })
}
//详情
export const storeDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/store/edit/ids/' + ids })
}
/**
 * 出库单
 */
// 查看列表
export const sendIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/deliver/index', params })
}
// 新增
export const sendAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/add', data })
}
//修改
export const sendEdit = (data: any, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/edit/ids/' + ids, data })
}
//查看
export const lookEdit = (ids: string): Promise<IResponse> => {
  return request.get({ url: '/api/deliver/edit/ids/' + ids })
}
//下拉列表
export const deliverGetSelectList = (): Promise<IResponse> => {
  return request.get({ url: '/api/deliver/getSelectList' })
}
//删除
export const sendDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/del', data: { ids } })
}
//获取出库单-运单号
export const getDeliverByWaybill = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/getDeliverByWaybill', params })
}
// 设置状态
export const deliverSetStatus = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/setStatus', data })
}
// 合包
export const deliverCombine = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/combine', data })
}

// 倒桩
export const deliverBackup = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/backup', data })
}

//导出excel
export const deliverExport = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/deliver/export/ids/' + ids, responseType: 'blob' })
}

// 导出出库单
export const fhdExportExcel = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/exportExcel/status/0', responseType: 'blob', data })
}

// 导出待出库单
export const dfhdExportExcel = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/exportExcel/status/1', responseType: 'blob', data })
}

/**
 * 清关单
 */
// 查看列表
export const customs_orderIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/customs_order/index', params })
}
// 新增
export const customs_orderAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/customs_order/add', data })
}
//修改
export const customs_orderEdit = (
  data: CustomsClearanceFormType,
  ids: string
): Promise<IResponse> => {
  return request.post({ url: '/api/customs_order/edit/ids/' + ids, data })
}
//删除
export const customs_orderDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/customs_order/del', data: { ids } })
}
//详情
export const customs_orderDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/customs_order/edit/ids/' + ids })
}

/**
 * 退货单
 */
// 查看列表
export const purchase_refundIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/purchase_refund/index', params })
}
// 新增
export const purchase_refundAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/purchase_refund/add', data })
}

/**
 * 用户分组
 */
//查看
export const userGroupIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/user_group/index', params })
}
//新增
export const userGroupAdd = (data: userGroupType): Promise<IResponse> => {
  return request.post({ url: '/api/user_group/add', data })
}
//修改
export const userGroupEdit = (ids: string, data: userGroupType): Promise<IResponse> => {
  return request.post({ url: '/api/user_group/edit/ids/' + ids, data })
}
//详情
export const userGroupDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/user_group/edit/ids/' + ids })
}
//查看
export const userGroupSelect = (): Promise<IResponse> => {
  return request.get({ url: '/api/user_group/selectpage' })
}

/**
 * 销售单
 */
//查看
export const saleIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/sale/index', params })
}
//新增
export const saleAdd = (data: purchaseType): Promise<IResponse> => {
  return request.post({ url: '/api/sale/add', data })
}
//修改
export const saleEdit = (ids: string, data: purchaseType): Promise<IResponse> => {
  return request.post({ url: '/api/sale/edit/ids/' + ids, data })
}
//删除
export const saleDEL = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/sale/del', data: { ids } })
}
//详情
export const saleDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/sale/edit/ids/' + ids })
}
//提交审核
export const saleSubmit = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/sale/submit', data: { ids } })
}

export const salePassed = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/sale/audit', data: { ids } })
}
//导出
export const saleExportSubmit = (ids: String): Promise<IResponse> => {
  return request.get({
    url: '/api/sale/export/ids/' + ids,
    responseType: 'blob'
  })
}
/**
 * 预到货单
 */
// 补充信息
export const buchongAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver_attachment/add', data })
}
// 审核预到货单
export const ydhdsetStatus = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver_attachment/setStatus', data })
}

//批量编辑出库单
export const deliverEditMulti = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/deliver/editMulti', data })
}

/**
 * 财务模块
 */
//销售单收款列表
export const receiptIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/receipt/index', params })
}
//销售单收款
export const receiptAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/receipt/add', data })
}
//采购付款单
export const paymentAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/payment/add', data })
}
//付款单收款列表
export const paymentIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/payment/index', params })
}
// 收款单详情
export const receiptDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/receipt/detail?ids=' + ids })
}
// 付款单详情
export const paymentDetail = (ids: String): Promise<IResponse> => {
  return request.get({ url: '/api/payment/detail?ids=' + ids })
}

/**
 * 打包材料
 */
//查看
export const materialIndex = (params: any): Promise<IResponse> => {
  return request.get({ url: '/api/material/index', params })
}
//新增
export const materialAdd = (data: any): Promise<IResponse> => {
  return request.post({ url: '/api/material/add', data })
}
//修改
export const materialEdit = (data: any, ids: string): Promise<IResponse> => {
  return request.post({ url: '/api/material/edit/ids//' + ids, data })
}
//删除
export const materialDel = (ids: String): Promise<IResponse> => {
  return request.post({ url: '/api/material/del', data: { ids } })
}
// 打包材料 - 下拉选择
export const materialSelect = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/material/selectpage', params })
}
